<?php

namespace Users\Form;

use Zend\Form\Form;

class UserEditForm extends Form
{
	public function __construct($name = null)
	{
		parent::__construct('UserEditForm');
		$this->setAttribute('method', 'post');
		$this->setAttribute('enctype','multipart/form-data');
			
		$this->add(array(
				'name' => 'id',
				'type' => 'Hidden',
		));
		
		$this->add(array(			
				'name' => 'name',
				'attributes' => array('type' => 'text',),
				'options' => array(	'label' => 'Full name',	),
				'attributes' => array('required' => 'required'),
				'filters' => array(	array('name' => 'StringTrim'),),
		));
				
		$this->add(array(
				'name' => 'email',
				'attributes' => array('type' => 'email','required' => 'required',),
				'options' => array('label' => 'E-mail',	),
			
				'filters' => array(	array('name' => 'StringTrim'),),
				'validators' => array(array('name' => 'EmailAddress',
				'options' => array('messages' => array(\Zend\Validator\EmailAddress::INVALID_FORMAT => 'Email address format is invalid'
										)
								)
						)
				)
		));
		
		$this->add(array(
				'name' => 'submit',
				'type' => 'submit',
				'attributes' => array('value' => 'Save',
				),
	
		));
		
	}
}

?>